<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META NAME="Generator" CONTENT="NetObjects Fusion 5.0 for Windows">
<TITLE>Forms</TITLE>
<HTML>
<HEAD>
<TITLE>JavaScript Source Code 3000:  Form Scripts</TITLE>
<META HTTP-EQUIV="JavaScript Source Code 3000" CONTENT="no-cache">
<META NAME="date" CONTENT="2000-09-09">
<META NAME="channel" CONTENT="Web Developer">
<META NAME="author" CONTENT="JavaScript Source Code 3000">
<META NAME="section" CONTENT="Forms">
<META NAME="description" CONTENT="JavaScript Forms -- These scripts all deal with Javascript forms.  I'll show you some really neat forms that keep you from receiving bogus information as well as others that are just fun to play with.">
<meta name="keywords" content="form validation required fields swap entries date pulldown menu mailing list email selection validation cookie validation guestbook validation">
<meta name="ROBOTS" content="ALL">
<meta name="title" content="JavaScript Source Code 3000 - Form Scripts">
<meta name="subject" content="JavaScript">
<LINK REL="stylesheet" href="../styles/jsstyles.css" /styles/jsstyles.css" type="text/css">
</HEAD>

<BODY>

<BR>

</CENTER>

<P CLASS="listingtxt">
These scripts all deal with Javascript forms.  I'll show you some really neat forms that keep you from receiving bogus information as well as others that are just fun to play with (test personal info).  As always, we're here if you have any questions or comments.  
<hr noshade size=5 class="listing"></P>

<!--content_start-->

<P CLASS="listingtxt">
<b>Title:</b> <a name="Agree_Before_Entry" href="agree-before-entry.html" /forms/agree-before-entry.html">Agree Before Entry</a><br><b>Details:</b> 1.12 KB * Uploaded October 28 1999<br><b>Description:</b>  JavaScript will only let you enter your name in this form if you indicate you agree to the terms by first clicking the I Agree radio button.  If you agree, you can enter your name.  But, if you disagree, you will not be able to enter or edit your name.  When you disagree, the box is 'locked.'  Useful if you require your visitors to accept a disclaimer before downloading software or visiting a section of your members-only site.</P><P CLASS="listingalign" align=right>[ <a href="agree-before-entry.html#source" /forms/agree-before-entry.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="All_Lower_Case" href="all-lower-case.html" /forms/all-lower-case.html">All Lower Case</a><br><b>Details:</b> 0.55 KB * Uploaded August 10 1999<br><b>Description:</b>  Converts a textbox entry to all lowercase letters as soon as they move to the next item in the form (or click the submit button).</P><P CLASS="listingalign" align=right>[ <a href="all-lower-case.html#source" /forms/all-lower-case.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="All_Upper_Case" href="all-upper-case.html" /forms/all-upper-case.html">All Upper Case</a><br><b>Details:</b> 0.55 KB * Uploaded August 9 1999<br><b>Description:</b>  Converts a textbox entry to all capital letters as soon as they move to the next item in the form (or click the submit button).</P><P CLASS="listingalign" align=right>[ <a href="all-upper-case.html#source" /forms/all-upper-case.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="Auto_Month" href="auto-month.html" /forms/auto-month.html">Auto Month</a><br><b>Contributor:</b>  <a href="mailto:d1102@home.com">Don Demrow</a>  (<a href="mailto:d1102@home.com">d1102@home.com</a>)<br><b>Contributor URL:</b>&nbsp;<a href="javascript:if(confirm('http://resume.w3site.com/  \n\nYou must be connected to the Internet to access this link.  \n\nDo you want to open it from the server?'))window.location='http://resume.w3site.com/'" tppabs="http://resume.w3site.com/">http://resume.w3site.com</a><br><b>Details:</b> 1.74 KB * Uploaded February 5 2001<br><b>Description:</b>  This pulldown menu will automatically adjust the range of months so that the current month is at the top.  The remaining months are placed in order after the current month.</P><P CLASS="listingalign" align=right>[ <a href="auto-month.html#source" /forms/auto-month.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="anywheremail" href="anywhere-mail.html" /forms/anywhere-mail.html">Anywhere Mail</a><BR><b>Details:</b> 1.02 KB * Uploaded August 4 1997<br><b>Description:</b>  Use this script to allow visitors to mail anyone, at any time.</P><P CLASS="listingalign" align=right>[ <a href="anywhere-mail.html#source" /forms/anywhere-mail.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="Auto_Email_Link" href="auto-email-link.html" /forms/auto-email-link.html">Auto Email Link</a><br><b>Contributor:</b>  <a href="mailto:support@codelifter.com">CodeLifter.com</a>  (<a href="mailto:support@codelifter.com">support@codelifter.com</a>)<br><b>Contributor URL:</b>&nbsp;<a href="javascript:if(confirm('http://www.codelifter.com/  \n\nYou must be connected to the Internet to access this link.  \n\nDo you want to open it from the server?'))window.location='http://www.codelifter.com/'" tppabs="http://www.codelifter.com/">http://www.codelifter.com</a><br><b>Details:</b> 1.69 KB * Uploaded February 21 2001<br><b>Description:</b>  Automatically opens a new e-mail using your default e-mail client and fills in the subject line and body with the address of the current web page.  Neat!</P><P CLASS="listingalign" align=right>[ <a href="auto-email-link.html#source" /forms/auto-email-link.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="Auto_Tab" href="auto-tab.html" /forms/auto-tab.html">Auto Tab</a><br><b>Contributor:</b>  <a href="mailto:leo7278@hotmail.com">Cyanide_7</a>  (<a href="mailto:leo7278@hotmail.com">leo7278@hotmail.com</a>)<br><b>Contributor URL:</b>&nbsp;<a href="javascript:if(confirm('http://www7.ewebcity.com/cyanide7  \n\nYou must be connected to the Internet to access this link.  \n\nDo you want to open it from the server?'))window.location='http://www7.ewebcity.com/cyanide7'" tppabs="http://www7.ewebcity.com/cyanide7">http://www7.ewebcity.com/cyanide7</a><br><b>Details:</b> 1.68 KB * Uploaded April 21 2000<br><b>Description:</b>  Automatically sets focus to the next form element when the current form element's maxlength has been reached. This way, the user does not have to manually click in or tab to the next field.  This script is perfectly suited for constant-length strings such as a phone number or social security numbers.  Nice!</P><P CLASS="listingalign" align=right>[ <a href="auto-tab.html#source" /forms/auto-tab.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="Auto_Year" href="auto-year.html" /forms/auto-year.html">Auto Year</a><br><b>Contributor:</b>  <a href="mailto:d1102@home.com">Don Demrow</a>  (<a href="mailto:d1102@home.com">d1102@home.com</a>)<br><b>Contributor URL:</b>&nbsp;<a href="javascript:if(confirm('http://resume.w3site.com/  \n\nYou must be connected to the Internet to access this link.  \n\nDo you want to open it from the server?'))window.location='http://resume.w3site.com/'" tppabs="http://resume.w3site.com/">http://resume.w3site.com</a><br><b>Details:</b> 1.09 KB * Uploaded January 25 2001<br><b>Description:</b>  This pulldown menu will automatically adjust the range of years depending on the current year.  As an added bonus, the range is easily modified.  Awesome!</P><P CLASS="listingalign" align=right>[ <a href="auto-year.html#source" /forms/auto-year.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="Basic Validation" href="basic-validation.html" /forms/basic-validation.html">Basic Validation</a><br><b>Contributor:</b>  wsabstract.com  <br><b>Details:</b> 1.41 KB * Uploaded April 14 1999<br><b>Description:</b>  The simplest way to require visitors to fill out certain fields is to us this script - just add the word "required" to each required field's name and your visitor must fill it out to submit the form!  Neat!</P><P CLASS="listingalign" align=right>[ <a href="basic-validation.html#source" /forms/basic-validation.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="Block_Key_Press" href="block-key-press.html" /forms/block-key-press.html">Block Key Press</a><br><b>Contributor:</b>  <a href="mailto:wollard@flash.net">Jeremy Wollard</a>  (<a href="mailto:wollard@flash.net">wollard@flash.net</a>)<br><b>Details:</b> 0.99 KB * Uploaded July 13 2000<br><b>Description:</b>  (Internet Explorer Only)  Using the OnKeypress event, you can trap and prevent certain characters (repesented by ASCII decimal codes) from being entered in a form field.  Just look up the ASCII code for any other characters you wish to block and add it to the script.  Unfortunately, Netscape does not support this same functionality.</P><P CLASS="listingalign" align=right>[ <a href="block-key-press.html#source" /forms/block-key-press.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="Check_All" href="../buttons/check-all.html" /buttons/check-all.html">Check All</a><br><b>Contributor:</b>  Nannette Thacker  <br><b>Contributor URL:</b>&nbsp;<a href="javascript:if(confirm('http://www.shiningstar.net/  \n\nYou must be connected to the Internet to access this link.  \n\nDo you want to open it from the server?'))window.location='http://www.shiningstar.net/'" tppabs="http://www.shiningstar.net/">http://www.shiningstar.net</a><br><b>Details:</b> 1.39 KB * Uploaded April 28 2000<br><b>Description:</b>  Dynamically checks and unchecks all the checkboxes in a form when a button is clicked.  Much easier than manually hard-coding the checkbox names, for sure.</P><P CLASS="listingalign" align=right>[ <a href="../buttons/check-all.html#source" /buttons/check-all.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="Check_Entry" href="check-entry.html" /forms/check-entry.html">Check Entry</a><br><b>Details:</b> 0.95 KB * Uploaded September 8 1999<br><b>Description:</b>  Prevents the user from selecting a filename with a space (known to cause problems with some CGI-scripts). The visitor are informed that the field can not have spaces.  Of course, you could change the character it checks for as well as the invalid alert message to something else to suit your needs.  Nice!</P><P CLASS="listingalign" align=right>[ <a href="check-entry.html#source" /forms/check-entry.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="Checkbox_Changer" href="checkbox-changer.html" /forms/checkbox-changer.html">Checkbox Changer</a><br><b>Details:</b> 1.94 KB * Uploaded July 27 1999<br><b>Description:</b>  Takes a series of known named checkboxes and checks or uncheck them all at once.  It can even change each checkbox to the opposite checked or not checked value.  Clever for loops!</P><P CLASS="listingalign" align=right>[ <a href="checkbox-changer.html#source" /forms/checkbox-changer.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="Checkbox_Counter" href="checkbox-counter.html" /forms/checkbox-counter.html">Checkbox Counter</a><br><b>Contributor:</b>  <a href="mailto:alan@performantsystems.com">Alan Gruskoff</a>  (<a href="mailto:alan@performantsystems.com">alan@performantsystems.com</a>)<br><b>Contributor URL:</b>&nbsp;<a href="javascript:if(confirm('http://www.performantsystems.com/  \n\nYou must be connected to the Internet to access this link.  \n\nDo you want to open it from the server?'))window.location='http://www.performantsystems.com/'" tppabs="http://www.performantsystems.com/">http://www.performantsystems.com/</a><br><b>Details:</b> 1.60 KB * Uploaded November 28 2000<br><b>Description:</b>  Easily count the number of checkboxes that have been selected.  Easy!</P><P CLASS="listingalign" align=right>[ <a href="checkbox-counter.html#source" /forms/checkbox-counter.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="Checkbox_Text" href="checkbox-text.html" /forms/checkbox-text.html">Checkbox Text</a><br><b>Contributor:</b>  <a href="mailto:trs2005@yahoo.com">trs2005@yahoo.com</a>  (<a href="mailto:trs2005@yahoo.com">trs2005@yahoo.com</a>)<br><b>Details:</b> 0.97 KB * Uploaded July 20 2000<br><b>Description:</b>  (Internet Explorer Only) The user no longer needs to click precisely on the checkbox to check and uncheck it.  Clicking the text after a checkbox can do this just like windows programs.</P><P CLASS="listingalign" align=right>[ <a href="checkbox-text.html#source" /forms/checkbox-text.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="Clean_CAPS" href="clean-caps.html" /forms/clean-caps.html">Clean CAPS</a><br><b>Contributor:</b>  Ronnie T. Moore, Editor  <br><b>Details:</b> 1.24 KB * Uploaded August 24 2000<br><b>Description:</b>  Keep users from typing in all caps, but still allow for capital letter strings for things like initials (JPC) or uppercase abbreviations (NASA or WWII).  You can easily change the number of capital letters allowed in a row after which the capital letterstring is converted to lowercase.</P><P CLASS="listingalign" align=right>[ <a href="clean-caps.html#source" /forms/clean-caps.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="Commas" href="commas.html" /forms/commas.html">Commas</a><br><b>Contributor:</b>  <a href="mailto:mark_henwood@hotmail.com">Mark Henwood</a>  (<a href="mailto:mark_henwood@hotmail.com">mark_henwood@hotmail.com</a>)<br><b>Details:</b> 1.51 KB * Uploaded January 2 2001<br><b>Description:</b>  Quickly add commas to any numerical form input.  Great for displaying large numbers!</P><P CLASS="listingalign" align=right>[ <a href="commas.html#source" /forms/commas.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="Confirmable_Order_Form" href="confirm-order.html" /forms/confirm-order.html">Confirmable Order Form</a><br><b>Details:</b> 4.79 KB * Uploaded July 15 1999<br><b>Description:</b>  JavaScript can take the contents of an HTML order form, process them, and display the order for verification even including the grand total!  When the user confirms the order by clicking the button, the order is emailed to you by using freedback.com's free form processor cgi script.  This script does take a bit of modification, but surely is worth it if you sell anything online.</P><P CLASS="listingalign" align=right>[ <a href="confirm-order-thanks.html#source" /forms/confirm-order-thanks.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="Controlled_Boxes" href="controlled-boxes.html" /forms/controlled-boxes.html">Controlled Boxes</a><br><b>Contributor:</b>  Scott Waichler<br><b>Details:</b> 1.78 KB * Uploaded June 25 1999<br><b>Description:</b>  This script allows checkboxes to check and uncheck based on the selection in another checkbox.   If the ALL box is checked, all the other choices go unchecked.  If another choice is checked, then the ALL box goes unchecked.  Useful when constructing search forms, surveys, and more!</P><P CLASS="listingalign" align=right>[ <a href="controlled-boxes.html#source" /forms/controlled-boxes.html#source">Get Source Code</a> ]</font></div></td>
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="Copy_Fields" href="copy-fields.html" /forms/copy-fields.html">Copy Fields</a><br><b>Details:</b> 8.75 KB * Uploaded November 10 1999<br><b>Description:</b>  Allows the user to click a checkbox on a form to duplicate information.  For example, they can copy their billing information into the shipping information fields (assuming they are the same) with one click!  Another useful timesaver for your visitors!</P><P CLASS="listingalign" align=right>[ <a href="copy-fields.html#source" /forms/copy-fields.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="Copy_Name" href="copy-name.html" /forms/copy-name.html">Copy Name</a><br><b>Details:</b> 0.53 KB * Uploaded September 14 1999<br><b>Description:</b>  Allows the user to enter their name in the first field and have copies it to the second field for use as the User ID.  It occurs instantly when they click the next field or the submit button.  And, if the user tries to modify the second field, it is changed back to the value of the name field.  Definitely a good example of the onChange() event handler in use.</P><P CLASS="listingalign" align=right>[ <a href="copy-name.html#source" /forms/copy-name.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="country" href="country.html" /forms/country.html">Country Chooser</a><BR><b>Details:</b> 6.08 KB * Uploaded July 24 1998<br><b>Description:</b>  If you'd like to know where visitors to your site live, add this to your feedback forms.  They just choose a region, and the second menu changes appropriately, allowing them to choose their country.  (If they choose USA, it allows them to select their state) Neat!</P><P CLASS="listingalign" align=right>[ <a href="country.html#source" /forms/country.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="Currency_Format" href="currency-format.html" /forms/currency-format.html">Currency Format</a><br><b>Contributor:</b>  <a href="mailto:leo7278@hotmail.com">Cyanide_7</a>  (<a href="mailto:leo7278@hotmail.com">leo7278@hotmail.com</a>)<br><b>Contributor URL:</b>&nbsp;<a href="javascript:if(confirm('http://www7.ewebcity.com/cyanide7  \n\nYou must be connected to the Internet to access this link.  \n\nDo you want to open it from the server?'))window.location='http://www7.ewebcity.com/cyanide7'" tppabs="http://www7.ewebcity.com/cyanide7">http://www7.ewebcity.com/cyanide7</a><br><b>Details:</b> 1.47 KB * Uploaded May 18 2000<br><b>Description:</b>  This script accepts a number or string and formats it like U.S. currency. Adds the dollar sign, rounds to two places past the decimal, adds place holding zeros, and commas where appropriate.  Occurs when the user clicks the button or when they finish entering the money amount (and click into the next field).</P><P CLASS="listingalign" align=right>[ <a href="currency-format.html#source" /forms/currency-format.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="openwindow" href="open-window.html" /forms/open-window.html">Customized Window</a><BR><b>Details:</b> 2.54 KB * Uploaded July 11 1997<br><b>Description:</b> Use Javascript to allow visitors to open a customized window.</P><P CLASS="listingalign" align=right>[ <a href="open-window.html#source" /forms/open-window.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="day-menu" href="day-menu.html" /forms/day-menu.html">Day Menu</a><BR><b>Details:</b> 1.20 KB * Uploaded October 4 1998<br><b>Description:</b>  Do you need your visitors to select a day from this month? Here's an excellent way to do so - they get a pulldown menu containing the entire month and the curre
<BASE TARGET="_parent">
<LINK REL=STYLESHEET TYPE="text/css" HREF="../Forms/style.css">
<LINK REL=STYLESHEET TYPE="text/css" HREF="../Forms/site.css">
<STYLE>
</STYLE>
</HEAD>
<BODY TOPMARGIN=2 LEFTMARGIN=2 MARGINWIDTH=2 MARGINHEIGHT=2>
</BODY>
</HTML>
 